<?php 
/**
 * TomatoCMS
 * 
 * LICENSE
 *
 * This source file is subject to the GNU GENERAL PUBLIC LICENSE Version 2 
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.gnu.org/licenses/gpl-2.0.txt
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@tomatocms.com so we can send you a copy immediately.
 * 
 * @copyright	Copyright (c) 2009-2010 TIG Corporation (http://www.tig.vn)
 * @license		http://www.gnu.org/licenses/gpl-2.0.txt GNU GENERAL PUBLIC LICENSE Version 2
 * @version 	$Id: index.phtml 4185 2010-08-01 16:31:02Z huuphuoc $
 * @since		2.0.0
 */
?>
<?php
$this->headTitle($this->translator('dashboard_index_page_title'));

/**
 * Dashboard editor
 * @since 2.0.7
 */
$this->headLink()
	->appendStylesheet($this->APP_STATIC_SERVER . '/js/jquery.ui/themes/base/ui.core.css')
	->appendStylesheet($this->APP_STATIC_SERVER . '/js/jquery.ui/themes/base/ui.resizable.css')
	->appendStylesheet($this->APP_STATIC_SERVER . '/js/jquery.ui/themes/base/ui.dialog.css')
	->appendStylesheet($this->APP_STATIC_SERVER . '/js/jquery.ui/themes/base/ui.tabs.css')
	->appendStylesheet($this->APP_STATIC_SERVER . '/js/jquery.ui/themes/base/ui.theme.css')
	->appendStylesheet($this->APP_STATIC_SERVER . '/js/jquery.ui/themes/base/ui.datepicker.css');

$this->headScript()
	->appendFile($this->APP_STATIC_SERVER . '/js/jquery.ui/ui.core.js')
	->appendFile($this->APP_STATIC_SERVER . '/js/jquery.ui/ui.tabs.js')
	->appendFile($this->APP_STATIC_SERVER . '/js/jquery.ui/ui.sortable.js')
	->appendFile($this->APP_STATIC_SERVER . '/js/jquery.ui/ui.draggable.js')
	->appendFile($this->APP_STATIC_SERVER . '/js/jquery.ui/ui.droppable.js')
	->appendFile($this->APP_STATIC_SERVER . '/js/jquery.ui/ui.resizable.js')
	->appendFile($this->APP_STATIC_SERVER . '/js/jquery.ui/ui.dialog.js')
	->appendFile($this->APP_STATIC_SERVER . '/js/jquery.ui/ui.datepicker.js')
	->appendFile($this->APP_STATIC_SERVER . '/js/tomato/core/colorconverter.js')
	->appendFile($this->APP_STATIC_SERVER . '/js/tomato/core/layout.lang.js')
	->appendFile($this->APP_STATIC_SERVER . '/js/tomato/core/layout.container.js')
	->appendFile($this->APP_STATIC_SERVER . '/js/tomato/core/layout.widget.js')
	->appendFile($this->APP_STATIC_SERVER . '/js/tomato/core/layout.defaultoutput.js');
?>

<div class="dashboard">
    <div class="box">
    		<img src="<?php echo $this->APP_STATIC_SERVER; ?>/skins/admin/default/images/users.png" alt="" />
	    <h2>
	        <?php echo $this->translator('menu_system_user', 'core'); ?>:
	    </h2>
	    <ul>
	
	        <?php if ($this->routeAccessor('core_role_list')) : ?>
	        <li><a href="<?php echo $this->url(array(), 'core_role_list'); ?>"><?php echo $this->translator('menu_role', 'core'); ?></a></li>
	        <?php endif; ?>
	
	    <?php if ($this->routeAccessor('core_user_list')) : ?>
	        <li><a href="<?php echo $this->url(array(), 'core_user_list'); ?>"><?php echo $this->translator('menu_user', 'core'); ?></a></li>
	        <?php endif; ?>
	
	        <?php if ($this->routeAccessor('core_privilege_list')) : ?>
	        <li><a href="<?php echo $this->url(array(), 'core_privilege_list'); ?>"><?php echo $this->translator('menu_privilege', 'core'); ?></a></li>
	        <?php endif; ?>
	    </ul>
	</div>	    
    	<hr />
    	<div class="box">
    		<img src="<?php echo $this->APP_STATIC_SERVER; ?>/skins/admin/default/images/settings.png" alt="" />
	    	<h2>
	        <?php echo $this->translator('menu_system_config', 'core'); ?>:
	     </h2>	     
		<ul>

        <?php if ($this->routeAccessor('core_language_list')) : ?>
                        <li><a href="<?php echo $this->url(array(), 'core_language_list'); ?>"><?php echo $this->translator('menu_language', 'core'); ?></a></li>
                        <?php endif; ?>
                        <?php
                        /**
                         * @since 2.0.8
                         */
                        ?>
                        <?php if ($this->routeAccessor('core_locale_config')) : ?>
                        <li><a href="<?php echo $this->url(array(), 'core_locale_config'); ?>"><?php echo $this->translator('menu_locale', 'core'); ?></a></li>
                        <?php endif; ?>

        <?php if ($this->routeAccessor('core_config_app')) : ?>
                        <li><a href="<?php echo $this->url(array(), 'core_config_app'); ?>"><?php echo $this->translator('menu_config_app', 'core'); ?></a></li>
                        <?php endif; ?>

        <?php if ($this->routeAccessor('core_config_list')) : ?>
                        <li><a href="<?php echo $this->url(array(), 'core_config_list'); ?>"><?php echo $this->translator('menu_config', 'core'); ?></a></li>
                        <?php endif; ?>

                        <?php if ($this->routeAccessor('core_cache_list')) : ?>
                        <li><a href="<?php echo $this->url(array(), 'core_cache_list'); ?>"><?php echo $this->translator('menu_cache', 'core'); ?></a></li>
                        <?php endif; ?>

        <?php if ($this->routeAccessor('core_cache_config')) : ?>
                        <li><a href="<?php echo $this->url(array(), 'core_cache_config'); ?>"><?php echo $this->translator('menu_cache_config', 'core'); ?></a></li>
                        <?php endif; ?>
    		</ul>
    </div>
    <hr />
    <div class="box">
    		<img src="<?php echo $this->APP_STATIC_SERVER; ?>/skins/admin/default/images/templates.png" alt="" />
	    <h2>
	        <?php echo $this->translator('menu_custome', 'core'); ?>:
	    </h2>	    
	    <ul>
	
	    <?php if ($this->routeAccessor('core_template_list')) : ?>
	                    <li><a href="<?php echo $this->url(array(), 'core_template_list'); ?>"><?php echo $this->translator('menu_template', 'core'); ?></a></li>
	                    <?php endif; ?>
	
	                    <?php
	                    /**
	                     * Customize permalink
	                     * @since 2.0.7
	                     */
	                    ?>
	                    <?php if ($this->routeAccessor('core_permalink_index')) : ?>
	                    <li><a href="<?php echo $this->url(array(), 'core_permalink_index'); ?>"><?php echo $this->translator('menu_permalink', 'core'); ?></a></li>
	                    <?php endif; ?>
	    </ul>
    </div>
    <hr />
    <div class="box">
    		<img src="<?php echo $this->APP_STATIC_SERVER; ?>/skins/admin/default/images/logs.png" alt="" />
	    <h2><?php echo $this->translator('menu_report', 'core'); ?>:</h2>
	    <ul>
	        <?php
	        /**
	         * Errors log
	         * @since 2.0.7
	         */
	        ?>
	        <?php if ($this->routeAccessor('core_log_list')) : ?>
	        <li><a href="<?php echo $this->url(array(), 'core_log_list'); ?>"><?php echo $this->translator('menu_log', 'core'); ?></a></li>
	        <?php endif; ?>
	    </ul>
    </div>
    <hr />
    <div class="box">
    		<img src="<?php echo $this->APP_STATIC_SERVER; ?>/skins/admin/default/images/modules.png" alt="" />
	    <h2>
	        <?php echo $this->translator('dashboard_core_modules_list', 'core'); ?>:
	    </h2>	    
	    <ul>
	        <li>
	            <a href="#"><?php echo $this->translator('menu_modules', 'core'); ?></a>
	            <div>
	                        <?php foreach (($modules = $this->moduleTask()) as $index => $module) : ?>
	                        <div style="width: 280px; float: left; height: 100px;">
	                            <?php if ($index % 4 == 0 & $index > 0) : ?><div class="clearfix"></div><?php endif; ?>
	                            <ul>
	                                    <li><span><?php echo $module['description']; ?></span></li>
	
	                                    <?php foreach ($module['tasks'] as $task) : ?>
	                                    <li><a href="<?php echo $task['link']; ?>"><?php echo $task['label']; ?></a></li>
	                                    <?php endforeach; ?>
	                            </ul>
	                        </div>
	                        <?php endforeach; ?>
	        </div>
	        </li>
	     </ul>
     </div>
</div>
